package com.beiye.drivertransport.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.beiye.drivertransport.R;
import com.beiye.drivertransport.bean.PreJobTrainingBean;

/**
 * Created by ky on 2018/1/10.
 */


public class PreJobTrainingRecycleradatper extends ListBaseAdapter<PreJobTrainingBean.RowsBean.ListCourseBean> {

    protected Context context = null;
    public PreJobTrainingRecycleradatper(Context context){
        super(context);
        this.context = context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.child_prejob_item;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        PreJobTrainingBean.RowsBean.ListCourseBean listCourseBean = getDataList().get(position);

        ImageView img_course =  holder.getView(R.id.img_course);
        TextView tv_title = holder.getView(R.id.tv_course);
        TextView tv_coursetime = holder.getView(R.id.tv_course2);
        ImageView tv_courseno = holder.getView(R.id.tv_course5);
//        TextView tv_num = holder.getView(R.id.tv_course3);
        //     TextView tv_courseyes = holder.getView(R.id.tv_course6);
        tv_title.setText(listCourseBean.getCourseName());
        tv_coursetime.setText("课程时长:"+listCourseBean.getCourseLength()+"分");
//        tv_num.setText("已读次数:"+rowsBean.getReadNo()+"次");
        if(listCourseBean.getStudyState()==0)
        {
            tv_courseno.setImageResource(R.mipmap.wxx);
            img_course.setImageResource(R.mipmap.icon_kccs_03);
        }else if(listCourseBean.getStudyState()==1)
        {
            tv_courseno.setImageResource(R.mipmap.yxx);
            img_course.setImageResource(R.mipmap.icon_kccs_06);
        }




        //   Picasso.with(context).load(Uri.parse(AppInterfaceConfig.getRequestUrl(rowsBean.getTopPicUrl()))).placeholder(R.mipmap.no_data).into(img_course);//加载图片


    }




}